#include"Reactor.hpp"
#include "Listener.hpp"
#include <iostream>
using namespace std;


using namespace EpollModule;
int main(int argc,char *argv[])
{
    ENABLE_CONSOLE_LOG_STRATEGY();
    if(argc != 2)
    {
        std::cout << "Usage: " << argv[0] << " port" << std::endl;
        return -1;
    }
    uint16_t port = stoi(argv[1]);
    // Listener listener(port);
    std::shared_ptr<Reactor> epoll_server = make_shared<Reactor>();

    auto connection = std::make_shared<Listener>(port);

    epoll_server->InsertConnection(connection);
    // epoll_server->Init();
    epoll_server->Loop();
    
    return 0;
}